﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class bb_Login : System.Web.UI.Page
{
    private static string sqlstring = System.Configuration.ConfigurationManager.AppSettings["strConn"].ToString().Trim();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btn1_Click(object sender, EventArgs e)
    {
        string id = txtID.Text.Trim();
        string password = txtPassword.Text.Trim();
        users us = new users();
        us.id = id;
        us.password = password;
        int result = us.login(us);
        if (result > 0)
        {
            Session["id"] = id;
            Response.Redirect("~/bb/Main.aspx");
        }
        else
        {
           Response.Write("<script >alert(\"登录失败!请重新登录\")</script>");
        }
    }
}